package com.sphd.education.adapter;

import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.sphd.education.R;
import com.sphd.education.interfaces.RecyclerViewOnClickListener;
import com.sphd.education.view.materialprogressbar.MaterialProgressBarSupport;

/**
 * Created by Administrator on 2015/12/21.
 */
public class FooterViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener{
    public final MaterialProgressBarSupport mProgressView;
    public final TextView mTextView;
    public final Button loadingButton;
    public final LinearLayout showProgressLinear;
    public int position;
    private RecyclerViewOnClickListener recyclerViewOnClickListener;

    public FooterViewHolder(View view) {
        super(view);
        mProgressView = (MaterialProgressBarSupport) view.findViewById(R.id.progress_view);
        mTextView = (TextView) view.findViewById(R.id.tv_content);
        loadingButton = (Button) view.findViewById(R.id.loadin_button);
        showProgressLinear= (LinearLayout) view.findViewById(R.id.show_progress_linear);
        loadingButton.setOnClickListener(this);
    }

    @Override
    public String toString() {
        return super.toString() + " '" + mTextView.getText();
    }

    @Override
    public void onClick(View v) {
        recyclerViewOnClickListener.onTouch(v, position);
    }

    public void setRecyclerViewOnClickListener(RecyclerViewOnClickListener recyclerViewOnClickListener) {
        this.recyclerViewOnClickListener = recyclerViewOnClickListener;
    }
}